<script type="text/javascript">
	$(document).ready(function(){
		$('#login').click(function(e){
		if($("#username").val() && $("#password").val()){
			$.ajax({
					type: "POST",
					url: baseUrl+"beranda/login",
					data: $.param({
								username:$("#username").val(),
								password:$("#password").val()
							}),
					dataType:'json',
					success: function(data){
						if(data == 'success'){
							window.location = baseUrl+"beranda";
							$('.error_login').hide();
						}else{
							$('.error_login').show();
						}
					},
					error:function(){
						$('.error_login').show();						
					}
				});
			}
		e.preventDefault();
		});
	});
</script>
<div id="footer"><!-- Footer start here -->
    <div class="wrapper"><!-- 900px wrapper -->
    
        <article>
        
            <h3>Artikel Terbaru</h3>
            
            <ul class="footer_list">
				<?php foreach($recent_articles as $recent_article){ ?>
					<li><a href="<?php echo base_url()."articles/detail/".$recent_article['id_artikel'];?>"><?php echo $recent_article['judul'];?></a></li>
				<?php } ?>
            </ul>
        
        </article>
        
        <article>
        
            <h3>Kategori Artikel</h3>
            
            <ul class="footer_list">
                <?php 
				$i = 0;
				foreach($categories as $category){ ?>
					<li><span><a href="<?php echo base_url()."articles/article_category/".$i;?>"><?php echo $category; ?></a></span></li>
				<?php 
				$i++; 
				} ?>
            </ul>
        </article>
        
        <article>
        
            <h3>Follow Kami</h3>
            
            <ul id="follow_us">
                <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/facebook.png" alt="Facebook" /></a></li>
                <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/flickr.png" alt="Flickr" /></a></li>
                <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/linkedin.png" alt="Linkedin" /></a></li>
                <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/twitter.png" alt="Twitter" /></a></li>
                <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/youtube.png" alt="Youtube" /></a></li>
            </ul>
        
        </article>
        
        <article>
        	<div class="error_login">
				<img src="<?php echo base_url();?>images/site_icon/delete.png" class="response_img"/>
				<p>Mohon maaf, login gagal, silahkan ulangi kembali.</p>
			</div>
			<?php if($this->session->userdata('userdata') == NULL){ ?>
            <h3>Log In sebagai anggota</h3>
            <div id="footer_login">
                <span>Username Anda</span>
                <form method="POST" action="">
                <input type="text" required="required" autocomplete="off" name="username" id="username" />
                <span>Password Anda</span><input type="password" required="required" autocomplete="off" name="password" id="password" />
				<input type="submit" value="Login" id="login"/>
				<span><a style="text-decoration:underline" href="<?php echo base_url()."beranda/forget_password";?>">Lupa Password ? </a></span>
				<br /><br /> <br />
				<a href="<?php echo base_url()."beranda/register";?>"><input type="button" value="Register !"></a>
				<br/><br/>				
                </form>
            </div>
			<?php } ?>
    
        </article>
        
    </div><!-- 900px wrapper -->
	<div class="cleaner"></div>
    </div>
    <div class="cleaner"></div>
    
    <div id="small_footer"><!-- Small black footer -->
    <div class="wrapper"><!-- 900px wrapper -->
    
    	<span id="copyright">Copyright &copy; 2012 by <b>Dharmaksatria 2010</b>.</span>
        
        <ul id="small_footer_navi">
			<li><a href="<?php echo base_url();?>">Beranda</a></li>
			<li><a href="<?php echo base_url();?>articles">Artikel</a></li>
			<li><a href="<?php echo base_url();?>photos">Foto</a></li>
			<li><a href="<?php echo base_url();?>videos">Video</a></li>
            <li><a class="returnTop">Return to Top</a></li>
        </ul>
     
    </div><!-- 900px wrapper -->
    </div>